package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.model.vo.common.R;
import com.atguigu.spzx.product.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/product/index")
//@CrossOrigin
public class IndexController {
    @Resource
    ProductService productService;
    @GetMapping
    public R getIndexData(){
        Map<String, Object> map = productService.getIndexData();
        return R.ok().data(map);
    }
}
